package com.wbt.thread;

/**
 * @author daojin
 * @date 2022/6/10 12:11 下午
 */
public class TestMain {
    public static void main(String[] args) {
        MyThread t = new MyThread();
        t.start();
        System.out.println("kaishi ,,,,,");
        for (int i =0 ;i < 20;i++){
            try {
                Thread.sleep(1000L);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }

            System.out.println("t:" + t.getState() + " , isInterrup:" + t.isInterrupted() + " , Alive:" + t.isAlive());
            if(i == 5 || i == 10 ){
                t.interrupt();
                System.out.println("t:" + t.getState() + " , isInterrup:" + t.isInterrupted() + " , Alive:" + t.isAlive());
            }
        }
    }

}
